package com.qt.thread;

/**
 * @Author zsf
 * @Date 2023/10/3 0:08
 * @Version 1.0
 */
public class MyThreadDemo05 {

    public static void main(String[] args) throws InterruptedException {



        /*
        // 守护线程线程
        MyThread myThread1 = new MyThread("女神");
        MyThread2 myThread2 = new MyThread2("添购");

        myThread2.setDaemon(true);
        myThread1.start();
        myThread2.start();*/

        /*  礼让让线程
        Thread.yield();
        MyThread mt1 = new MyThread("小二");
        MyThread mt2 = new MyThread("老张");
        mt1.start();
        mt2.start(); */

        MyThread mt1 = new MyThread("小二");
        mt1.start();
        mt1.join();
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }


    }

}
